package com.haidechizi.i18n.code.generator.common.message.global;



import com.haidechizi.i18n.code.generator.common.message.param.Param;

import java.util.Optional;

public class GlobalParam {

    private static ThreadLocal<Param> paramThreadLocal = new ThreadLocal<>();

    public static void setParam(Param param) {
        paramThreadLocal.set(param);
    }

    public static Param getParam() {
        return Optional.ofNullable(paramThreadLocal.get()).orElse(new Param());
    }

    public static void remove() {
        paramThreadLocal.remove();
    }
}
